<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>perldocstyle - A style guide for writing Perl&#39;s documentation - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/perldocstyle">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perldocstyle.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/perldocstyle">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/perldocstyle">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/perldocstyle">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/perldocstyle">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/perldocstyle">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/perldocstyle">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/perldocstyle">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/perldocstyle">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/perldocstyle">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/perldocstyle">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/perldocstyle">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/perldocstyle">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/perldocstyle">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/perldocstyle">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/perldocstyle">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/perldocstyle">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/perldocstyle">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/perldocstyle">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/perldocstyle">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/perldocstyle">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/perldocstyle">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/perldocstyle">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/perldocstyle">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/perldocstyle">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/perldocstyle">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/perldocstyle">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/perldocstyle">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/perldocstyle">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/perldocstyle">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/perldocstyle">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/perldocstyle">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/perldocstyle">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/perldocstyle">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/perldocstyle">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/perldocstyle">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/perldocstyle">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/perldocstyle">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/perldocstyle">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/perldocstyle">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/perldocstyle">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/perldocstyle">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/perldocstyle">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/perldocstyle">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/perldocstyle">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/perldocstyle">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/perldocstyle">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/perldocstyle">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/perldocstyle">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/perldocstyle">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/perldocstyle">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/perldocstyle">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/perldocstyle">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/perldocstyle">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/perldocstyle">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/perldocstyle">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/perldocstyle">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/perldocstyle">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/perldocstyle">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/perldocstyle">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/perldocstyle">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/perldocstyle">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/perldocstyle">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/perldocstyle">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/perldocstyle">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/perldocstyle">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/perldocstyle">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/perldocstyle">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/perldocstyle">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/perldocstyle">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/perldocstyle">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/perldocstyle">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/perldocstyle">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/perldocstyle">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/perldocstyle">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/perldocstyle">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/perldocstyle">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/perldocstyle">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/perldocstyle">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/perldocstyle">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/perldocstyle">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perldocstyle.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/perldocstyle">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/perldocstyle">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/perldocstyle">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/perldocstyle">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/perldocstyle">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/perldocstyle">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/perldocstyle">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/perldocstyle">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/perldocstyle">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/perldocstyle">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/perldocstyle">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/perldocstyle">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/perldocstyle">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/perldocstyle">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/perldocstyle">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/perldocstyle">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/perldocstyle">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/perldocstyle">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/perldocstyle">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/perldocstyle">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/perldocstyle">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/perldocstyle">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/perldocstyle">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/perldocstyle">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/perldocstyle">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/perldocstyle">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/perldocstyle">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/perldocstyle">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/perldocstyle">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/perldocstyle">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/perldocstyle">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/perldocstyle">5.35.1</a>
          <a class="dropdown-item active" href="perldocstyle.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="perldocstyle.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="perldocstyle.html">perldocstyle</a>
          <div id="more">
            (<a href="perldocstyle.txt">source</a>,
            <a href="https://metacpan.org/pod/perldocstyle">CPAN</a>)
          </div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#DESCRIPTION">DESCRIPTION</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Purpose-of-this-guide">Purpose of this guide</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Intended-audience">Intended audience</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Status-of-this-document">Status of this document</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#FUNDAMENTALS">FUNDAMENTALS</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Choice-of-markup:-Pod">Choice of markup: Pod</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Choice-of-language:-American-English">Choice of language: American English</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Other-languages-and-translations">Other languages and translations</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Choice-of-encoding:-UTF-8">Choice of encoding: UTF-8</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Choice-of-underlying-style-guide:-CMOS">Choice of underlying style guide: CMOS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Contributing-to-Perl&#39;s-documentation">Contributing to Perl&#39;s documentation</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#FORMATTING-AND-STRUCTURE">FORMATTING AND STRUCTURE</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Document-structure">Document structure</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Name">Name</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Description-and-synopsis">Description and synopsis</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Other-sections-and-subsections">Other sections and subsections</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Author-and-copyright">Author and copyright</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Formatting-rules">Formatting rules</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Line-length-and-line-wrap">Line length and line wrap</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Code-blocks">Code blocks</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Inline-code-and-literals">Inline code and literals</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Function-names">Function names</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Function-arguments">Function arguments</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Apostrophes,-quotes,-and-dashes">Apostrophes, quotes, and dashes</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Unix-programs-and-C-functions">Unix programs and C functions</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Cross-references-and-hyperlinks">Cross-references and hyperlinks</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Tables-and-diagrams">Tables and diagrams</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Adding-comments">Adding comments</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Perlfunc-has-special-rules">Perlfunc has special rules</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#TONE-AND-STYLE">TONE AND STYLE</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Apply-one-of-the-four-documentation-modes">Apply one of the four documentation modes</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Tutorial">Tutorial</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Cookbook">Cookbook</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Reference">Reference</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Explainer">Explainer</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Further-notes-on-documentation-modes">Further notes on documentation modes</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Assume-readers&#39;-intelligence,-but-not-their-knowledge">Assume readers&#39; intelligence, but not their knowledge</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Keep-Perl&#39;s-documentation-about-Perl">Keep Perl&#39;s documentation about Perl</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Deploy-jargon-when-needed,-but-define-it-as-well">Deploy jargon when needed, but define it as well</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Use-meaningful-variable-and-symbol-names-in-examples">Use meaningful variable and symbol names in examples</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Write-in-English,-but-not-just-for-English-speakers">Write in English, but not just for English-speakers</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Omit-placeholder-text-or-commentary">Omit placeholder text or commentary</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Apply-section-breaks-and-examples-generously">Apply section-breaks and examples generously</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Lead-with-common-cases-and-best-practices">Lead with common cases and best practices</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Show-the-better-ways-first">Show the better ways first</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Show-the-lesser-ways-when-needed">Show the lesser ways when needed</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Document-Perl&#39;s-present">Document Perl&#39;s present</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Recount-the-past-only-when-necessary">Recount the past only when necessary</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#Describe-the-uncertain-future-with-care">Describe the uncertain future with care</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#The-documentation-speaks-with-one-voice">The documentation speaks with one voice</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#INDEX-OF-PREFERRED-TERMS">INDEX OF PREFERRED TERMS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#SEE-ALSO">SEE ALSO</a>
              </li>
              <li>
                <a class="text-decoration-none" href="perldocstyle.html#AUTHOR">AUTHOR</a>
              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="perldocstyle.html#NAME">#</a>NAME</h1>

<p>perldocstyle - A style guide for writing Perl&#39;s documentation</p>

<h1 id="DESCRIPTION"><a class="permalink" href="perldocstyle.html#DESCRIPTION">#</a>DESCRIPTION</h1>

<p>This document is a guide for the authorship and maintenance of the documentation that ships with Perl. This includes the following:</p>

<ul>

<li><p>The several dozen manual sections whose filenames begin with &quot;<code>perl</code>&quot;, such as <code>perlobj</code>, <code>perlre</code>, and <code>perlintro</code>. (And, yes, <code>perl</code>.)</p>

</li>
<li><p>The documentation for all the modules included with Perl (as listed by <a href="perlmodlib.html"><code>perlmodlib</code></a>).</p>

</li>
<li><p>The hundreds of individually presented reference sections derived from the <a href="perlfunc.html"><code>perlfunc</code></a> file.</p>

</li>
</ul>

<p>This guide will hereafter refer to user-manual section files as <i>man pages</i>, per Unix convention.</p>

<h2 id="Purpose-of-this-guide"><a class="permalink" href="perldocstyle.html#Purpose-of-this-guide">#</a><a id="Purpose"></a>Purpose of this guide</h2>

<p>This style guide aims to establish standards, procedures, and philosophies applicable to Perl&#39;s core documentation.</p>

<p>Adherence to these standards will help ensure that any one part of Perl&#39;s manual has a tone and style consistent with that of any other. As with the rest of the Perl project, the language&#39;s documentation collection is an open-source project authored over a long period of time by many people. Maintaining consistency across such a wide swath of work presents a challenge; this guide provides a foundation to help mitigate this difficulty.</p>

<p>This will help its readers--especially those new to Perl--to feel more welcome and engaged with Perl&#39;s documentation, and this in turn will help the Perl project itself grow stronger through having a larger, more diverse, and more confident population of knowledgeable users.</p>

<h2 id="Intended-audience"><a class="permalink" href="perldocstyle.html#Intended-audience">#</a><a id="Intended"></a>Intended audience</h2>

<p>Anyone interested in contributing to Perl&#39;s core documentation should familiarize themselves with the standards outlined by this guide.</p>

<p>Programmers documenting their own work apart from the Perl project itself may also find this guide worthwhile, especially if they wish their work to extend the tone and style of Perl&#39;s own manual.</p>

<h2 id="Status-of-this-document"><a class="permalink" href="perldocstyle.html#Status-of-this-document">#</a><a id="Status"></a>Status of this document</h2>

<p>This guide was initially drafted in late 2020, drawing from the documentation style guides of several open-source technologies contemporary with Perl. This has included Python, Raku, Rust, and the Linux kernel.</p>

<p>The author intends to see this guide used as starting place from which to launch a review of Perl&#39;s reams of extant documentation, with the expectation that those conducting this review should grow and modify this guide as needed to account for the requirements and quirks particular to Perl&#39;s programming manual.</p>

<h1 id="FUNDAMENTALS"><a class="permalink" href="perldocstyle.html#FUNDAMENTALS">#</a>FUNDAMENTALS</h1>

<h2 id="Choice-of-markup:-Pod"><a class="permalink" href="perldocstyle.html#Choice-of-markup:-Pod">#</a><a id="Choice"></a>Choice of markup: Pod</h2>

<p>All of Perl&#39;s core documentation uses Pod (&quot;Plain Old Documentation&quot;), a simple markup language, to format its source text. Pod is similar in spirit to other contemporary lightweight markup technologies, such as Markdown and reStructuredText, and has a decades-long shared history with Perl itself.</p>

<p>For a comprehensive reference to Pod syntax, see <a href="perlpod.html"><code>perlpod</code></a>. For the sake of reading this guide, familiarity with the Pod syntax for section headers (<code>=head2</code>, et cetera) and for inline text formatting (<code>C&lt;like this&gt;</code>) should suffice.</p>

<p>Perl programmers also use Pod to document their own scripts, libraries, and modules. This use of Pod has its own style guide, outlined by <a href="perlpodstyle.html"><code>perlpodstyle</code></a>.</p>

<h2 id="Choice-of-language:-American-English"><a class="permalink" href="perldocstyle.html#Choice-of-language:-American-English">#</a><a id="Choice1"></a>Choice of language: American English</h2>

<p>Perl&#39;s core documentation is written in English, with a preference for American spelling of words and expression of phrases. That means &quot;color&quot; over &quot;colour&quot;, &quot;math&quot; versus &quot;maths&quot;, &quot;the team has decided&quot; and not &quot;the team have decided&quot;, and so on.</p>

<p>We name one style of English for the sake of consistency across Perl&#39;s documentation, much as a software project might declare a four-space indentation standard--even when that doesn&#39;t affect how well the code compiles. Both efforts result in an easier read by avoiding jarring, mid-document changes in format or style.</p>

<p>Contributors to Perl&#39;s documentation should note that this rule describes the ultimate, published output of the project, and does not prescribe the dialect used within community contributions. The documentation team enthusiastically welcomes any English-language contributions, and will actively assist in Americanizing spelling and style when warranted.</p>

<h3 id="Other-languages-and-translations"><a class="permalink" href="perldocstyle.html#Other-languages-and-translations">#</a><a id="Other"></a>Other languages and translations</h3>

<p>Community-authored translations of Perl&#39;s documentation do exist, covering a variety of languages. While the Perl project appreciates these translation efforts and promotes them when applicable, it does not officially support or maintain any of them.</p>

<p>That said, keeping Perl&#39;s documentation clear, simple, and short has a welcome side effect of aiding any such translation project.</p>

<p>(Note that the Chinese, Japanese, and Korean-language README files included with Perl&#39;s source distributions provide an exception to this choice of language--but these documents fall outside the scope of this guide.)</p>

<h2 id="Choice-of-encoding:-UTF-8"><a class="permalink" href="perldocstyle.html#Choice-of-encoding:-UTF-8">#</a><a id="Choice2"></a>Choice of encoding: UTF-8</h2>

<p>Perl&#39;s core documentation files are encoded in UTF-8, and can make use of the full range of characters this encoding allows.</p>

<p>As such, every core doc file (or the Pod section of every core module) should commence with an <code>=encoding utf8</code> declaration.</p>

<h2 id="Choice-of-underlying-style-guide:-CMOS"><a class="permalink" href="perldocstyle.html#Choice-of-underlying-style-guide:-CMOS">#</a><a id="Choice3"></a>Choice of underlying style guide: CMOS</h2>

<p>Perl&#39;s documentation uses the <a href="https://www.chicagomanualofstyle.org">Chicago Manual of Style</a> (CMOS), 17th Edition, as its baseline guide for style and grammar. While the document you are currently reading endeavors to serve as an adequate stand-alone style guide for the purposes of documenting Perl, authors should consider CMOS the fallback authority for any pertinent topics not covered here.</p>

<p>Because CMOS is not a free resource, access to it is not a prerequisite for contributing to Perl&#39;s documentation; the doc team will help contributors learn about and apply its guidelines as needed. However, we do encourage anyone interested in significant doc contributions to obtain or at least read through CMOS. (Copies are likely available through most public libraries, and CMOS-derived fundamentals can be found online as well.)</p>

<h2 id="Contributing-to-Perl&#39;s-documentation"><a class="permalink" href="perldocstyle.html#Contributing-to-Perl&#39;s-documentation">#</a><a id="Contributing"></a><a id="Contributing-to-Perls-documentation"></a>Contributing to Perl&#39;s documentation</h2>

<p>Perl, like any programming language, is only as good as its documentation. Perl depends upon clear, friendly, and thorough documentation in order to welcome brand-new users, teach and explain the language&#39;s various concepts and components, and serve as a lifelong reference for experienced Perl programmers. As such, the Perl project welcomes and values all community efforts to improve the language&#39;s documentation.</p>

<p>Perl accepts documentation contributions through the same open-source project pipeline as code contributions. See <a href="perlhack.html"><code>perlhack</code></a> for more information.</p>

<h1 id="FORMATTING-AND-STRUCTURE"><a class="permalink" href="perldocstyle.html#FORMATTING-AND-STRUCTURE">#</a><a id="FORMATTING"></a>FORMATTING AND STRUCTURE</h1>

<p>This section details specific Pod syntax and style that all core Perl documentation should adhere to, in the interest of consistency and readability.</p>

<h2 id="Document-structure"><a class="permalink" href="perldocstyle.html#Document-structure">#</a><a id="Document"></a>Document structure</h2>

<p>Each individual work of core Perl documentation, whether contained within a <code>.pod</code> file or in the Pod section of a standard code module, patterns its structure after a number of long-time Unix man page conventions. (Hence this guide&#39;s use of &quot;man page&quot; to refer to any one self-contained part of Perl&#39;s documentation.)</p>

<p>Adhering to these conventions helps Pod formatters present a Perl man page&#39;s content in different contexts--whether a terminal, the web, or even print. Many of the following requirements originate with <a href="perlpodstyle.html"><code>perlpodstyle</code></a>, which derives its recommendations in turn from these well-established practices.</p>

<h3 id="Name"><a class="permalink" href="perldocstyle.html#Name">#</a>Name</h3>

<p>After its <a href="perldocstyle.html#Choice-of-encoding%3A-UTF-8"><code>=encoding utf8</code> declaration</a>, a Perl man page <i>must</i> present a level-one header named &quot;NAME&quot; (literally), followed by a paragraph containing the page&#39;s name and a very brief description.</p>

<p>The first few lines of a notional page named <code>perlpodexample</code>:</p>

<pre><code class="plaintext">=encoding utf8

=head1 NAME

perlpodexample - An example of formatting a manual page&#39;s title line</code></pre>

<h3 id="Description-and-synopsis"><a class="permalink" href="perldocstyle.html#Description-and-synopsis">#</a><a id="Description"></a>Description and synopsis</h3>

<p>Most Perl man pages also contain a DESCRIPTION section featuring a summary of, or introduction to, the document&#39;s content and purpose.</p>

<p>This section should also, one way or another, clearly identify the audience that the page addresses, especially if it has expectations about the reader&#39;s prior knowledge. For example, a man page that dives deep into the inner workings of Perl&#39;s regular expression engine should state its assumptions up front--and quickly redirect readers who are instead looking for a more basic reference or tutorial.</p>

<p>Reference pages, when appropriate, can precede the DESCRIPTION with a SYNOPSIS section that lists, within one or more code blocks, some very brief examples of the referenced feature&#39;s use. This section should show a handful of common-case and best-practice examples, rather than an exhaustive list of every obscure method or alternate syntax available.</p>

<h3 id="Other-sections-and-subsections"><a class="permalink" href="perldocstyle.html#Other-sections-and-subsections">#</a><a id="Other1"></a>Other sections and subsections</h3>

<p>Pages should conclude, when appropriate, with a SEE ALSO section containing hyperlinks to relevant sections of Perl&#39;s manual, other Unix man pages, or appropriate web pages. Hyperlink each such cross-reference via <code>L&lt;...&gt;</code>.</p>

<p>What other sections to include depends entirely upon the topic at hand. Authors should feel free to include further <code>=head1</code>-level sections, whether other standard ones listed by <code>perlpodstyle</code>, or ones specific to the page&#39;s topic; in either case, render these top-level headings in all-capital letters.</p>

<p>You may then include as many subsections beneath them as needed to meet the standards of clarity, accessibility, and cross-reference affinity <a href="perldocstyle.html#Apply-one-of-the-four-documentation-modes">suggested elsewhere in this guide</a>.</p>

<h3 id="Author-and-copyright"><a class="permalink" href="perldocstyle.html#Author-and-copyright">#</a><a id="Author"></a>Author and copyright</h3>

<p>In most circumstances, Perl&#39;s stand-alone man pages--those contained within <code>.pod</code> files--do not need to include any copyright or license information about themselves. Their source Pod files are part of Perl&#39;s own core software repository, and that already covers them under the same copyright and license terms as Perl itself. You do not need to include additional &quot;LICENSE&quot; or &quot;COPYRIGHT&quot; sections of your own.</p>

<p>These man pages may optionally credit their primary author, or include a list of significant contributors, under &quot;AUTHOR&quot; or &quot;CONTRIBUTORS&quot; headings. Note that the presence of authors&#39; names does not preclude a given page from <a href="perldocstyle.html#The-documentation-speaks-with-one-voice">writing in a voice consistent with the rest of Perl&#39;s documentation</a>.</p>

<p>Note that these guidelines do not apply to the core software modules that ship with Perl. These have their own standards for authorship and copyright statements, as found in <code>perlpodstyle</code>.</p>

<h2 id="Formatting-rules"><a class="permalink" href="perldocstyle.html#Formatting-rules">#</a><a id="Formatting"></a>Formatting rules</h2>

<h3 id="Line-length-and-line-wrap"><a class="permalink" href="perldocstyle.html#Line-length-and-line-wrap">#</a><a id="Line"></a>Line length and line wrap</h3>

<p>Each line within a Perl man page&#39;s Pod source file should measure 72 characters or fewer in length.</p>

<p>Please break paragraphs up into blocks of short lines, rather than &quot;soft wrapping&quot; paragraphs across hundreds of characters with no line breaks.</p>

<h3 id="Code-blocks"><a class="permalink" href="perldocstyle.html#Code-blocks">#</a><a id="Code"></a>Code blocks</h3>

<p>Just like the text around them, all code examples should be as short and readable as possible, displaying no more complexity than absolutely necessary to illustrate the concept at hand.</p>

<p>For the sake of consistency within and across Perl&#39;s man pages, all examples must adhere to the code-layout principles set out by <a href="perlstyle.html"><code>perlstyle</code></a>.</p>

<p>Sample code should deviate from these standards only when necessary: during a demonstration of how Perl disregards whitespace, for example, or to temporarily switch to two-column indentation for an unavoidably verbose illustration.</p>

<p>You may include comments within example code to further clarify or label the code&#39;s behavior in-line. You may also use comments as placeholder for code normally present but not relevant to the current topic, like so:</p>

<pre><code>while (my $line = &lt;$fh&gt;) {
    #
    # (Do something interesting with $line here.)
    #
}</code></pre>

<p>Even the simplest code blocks often require the use of example variables and subroutines, <a href="perldocstyle.html#Use-meaningful-variable-and-symbol-names-in-examples">whose names you should choose with care</a>.</p>

<h3 id="Inline-code-and-literals"><a class="permalink" href="perldocstyle.html#Inline-code-and-literals">#</a><a id="Inline"></a>Inline code and literals</h3>

<p>Within a paragraph of text, use <code>C&lt;...&gt;</code> when quoting or referring to any bit of Perl code--even if it is only one character long.</p>

<p>For instance, when referring within an explanatory paragraph to Perl&#39;s operator for adding two numbers together, you&#39;d write &quot;<code>C&lt;+&gt;</code>&quot;.</p>

<h3 id="Function-names"><a class="permalink" href="perldocstyle.html#Function-names">#</a><a id="Function"></a>Function names</h3>

<p>Use <code>C&lt;...&gt;</code> to render all Perl function names in monospace, whenever they appear in text.</p>

<p>Unless you need to specifically quote a function call with a list of arguments, do not follow a function&#39;s name in text with a pair of empty parentheses. That is, when referring in general to Perl&#39;s <code>print</code> function, write it as &quot;<code>print</code>&quot;, not &quot;<code>print()</code>&quot;.</p>

<h3 id="Function-arguments"><a class="permalink" href="perldocstyle.html#Function-arguments">#</a><a id="Function1"></a>Function arguments</h3>

<p>Represent functions&#39; expected arguments in all-caps, with no sigils, and using <code>C&lt;...&gt;</code> to render them in monospace. These arguments should have short names making their nature and purpose clear. Convention specifies a few ones commonly seen throughout Perl&#39;s documentation:</p>

<ul>

<li><p>EXPR</p>

<p>The &quot;generic&quot; argument: any scalar value, or a Perl expression that evaluates to one.</p>

</li>
<li><p>ARRAY</p>

<p>An array, stored in a named variable.</p>

</li>
<li><p>HASH</p>

<p>A hash, stored in a named variable.</p>

</li>
<li><p>BLOCK</p>

<p>A curly-braced code block, or a subroutine reference.</p>

</li>
<li><p>LIST</p>

<p>Any number of values, stored across any number of variables or expressions, which the function will &quot;flatten&quot; and treat as a single list. (And because it can contain any number of variables, it must be the <i>last</i> argument, when present.)</p>

</li>
</ul>

<p>When possible, give scalar arguments names that suggest their purpose among the arguments. See, for example, <a href="perlfunc.html#substr"><code>substr</code>&#39;s documentation</a>, whose listed arguments include <code>EXPR</code>, <code>OFFSET</code>, <code>LENGTH</code>, and <code>REPLACEMENT</code>.</p>

<h3 id="Apostrophes,-quotes,-and-dashes"><a class="permalink" href="perldocstyle.html#Apostrophes,-quotes,-and-dashes">#</a><a id="Apostrophes"></a><a id="Apostrophes-quotes-and-dashes"></a>Apostrophes, quotes, and dashes</h3>

<p>In Pod source, use straight quotes, and not &quot;curly quotes&quot;: &quot;Like this&quot;, not “like this”. The same goes for apostrophes: Here&#39;s a positive example, and here’s a negative one.</p>

<p>Render em dashes as two hyphens--like this:</p>

<pre><code class="plaintext">Render em dashes as two hyphens--like this.</code></pre>

<p>Leave it up to formatters to reformat and reshape these punctuation marks as best fits their respective target media.</p>

<h3 id="Unix-programs-and-C-functions"><a class="permalink" href="perldocstyle.html#Unix-programs-and-C-functions">#</a><a id="Unix1"></a>Unix programs and C functions</h3>

<p>When referring to a Unix program or C function with its own man page (outside of Perl&#39;s documentation), include its manual section number in parentheses. For example: <code>malloc(3)</code>, or <code>mkdir(1)</code>.</p>

<p>If mentioning this program for the first time within a man page or section, make it a cross reference, e.g. <code>L&lt;malloc(3)&gt;</code>.</p>

<p>Do not otherwise style this text.</p>

<h3 id="Cross-references-and-hyperlinks"><a class="permalink" href="perldocstyle.html#Cross-references-and-hyperlinks">#</a><a id="Cross"></a>Cross-references and hyperlinks</h3>

<p>Make generous use of Pod&#39;s <code>L&lt;...&gt;</code> syntax to create hyperlinks to other parts of the current man page, or to other documents entirely -- whether elsewhere on the reader&#39;s computer, or somewhere on the internet, via URL.</p>

<p>Use <code>L&lt;...&gt;</code> to link to another section of the current man page when mentioning it, and make use of its page-and-section syntax to link to the most specific section of a separate page within Perl&#39;s documentation. Generally, the first time you refer to a specific function, program, or concept within a certain page or section, consider linking to its full documentation.</p>

<p>Hyperlinks do not supersede other formatting required by this guide; Pod allows nested text formats, and you should use this feature as needed.</p>

<p>Here is an example sentence that mentions Perl&#39;s <code>say</code> function, with a link to its documentation section within the <code>perlfunc</code> man page:</p>

<pre><code class="plaintext">In version 5.10, Perl added support for the 
L&lt;C&lt;say&gt;|perlfunc/say FILEHANDLE LIST&gt; function.</code></pre>

<p>Note the use of the vertical pipe (&quot;<code>|</code>&quot;) to separate how the link will appear to readers (&quot;<code>C&lt;say&gt;</code>&quot;) from the full page-and-section specifier that the formatter links to.</p>

<h3 id="Tables-and-diagrams"><a class="permalink" href="perldocstyle.html#Tables-and-diagrams">#</a><a id="Tables"></a>Tables and diagrams</h3>

<p>Pod does not officially support tables. To best present tabular data, include the table as both HTML and plain-text representations--the latter as an indented code block. Use <code>=begin</code> / <code>=end</code> directives to target these tables at <code>html</code> and <code>text</code> Pod formatters, respectively. For example:</p>

<pre><code class="plaintext">=head2 Table of fruits

=begin text

 Name           Shape           Color
 =====================================
 Apple          Round           Red
 Banana         Long            Yellow
 Pear           Pear-shaped     Green

=end text

=begin html

&lt;table&gt;
&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Shape&lt;/th&gt;&lt;th&gt;Color&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Apple&lt;/td&gt;&lt;td&gt;Round&lt;/td&gt;&lt;td&gt;Red&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Banana&lt;/td&gt;&lt;td&gt;Long&lt;/td&gt;&lt;td&gt;Yellow&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Pear&lt;/td&gt;&lt;td&gt;Pear-shaped&lt;/td&gt;&lt;td&gt;Green&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

=end html</code></pre>

<p>The same holds true for figures and graphical illustrations. Pod does not natively support inline graphics, but you can mix HTML <code>&lt;img&gt;</code> tags with monospaced text-art representations of those images&#39; content.</p>

<p>Due in part to these limitations, most Perl man pages use neither tables nor diagrams. Like any other tool in your documentation toolkit, however, you may consider their inclusion when they would improve an explanation&#39;s clarity without adding to its complexity.</p>

<h2 id="Adding-comments"><a class="permalink" href="perldocstyle.html#Adding-comments">#</a><a id="Adding"></a>Adding comments</h2>

<p>Like any other kind of source code, Pod lets you insert comments visible only to other people reading the source directly, and ignored by the formatting programs that transform Pod into various human-friendly output formats (such as HTML or PDF).</p>

<p>To comment Pod text, use the <code>=for</code> and <code>=begin</code> / <code>=end</code> Pod directives, aiming them at a (notional) formatter called &quot;<code>comment</code>&quot;. A couple of examples:</p>

<pre><code class="plaintext">=for comment Using &quot;=for comment&quot; like this is good for short,
single-paragraph comments.

=begin comment

If you need to comment out more than one paragraph, use a
=begin/=end block, like this.

None of the text or markup in this whole example would be visible to
someone reading the documentation through normal means, so it&#39;s
great for leaving notes, explanations, or suggestions for your
fellow documentation writers.

=end comment</code></pre>

<p>In the tradition of any good open-source project, you should make free but judicious use of comments to leave in-line &quot;meta-documentation&quot; as needed for other Perl documentation writers (including your future self).</p>

<h2 id="Perlfunc-has-special-rules"><a class="permalink" href="perldocstyle.html#Perlfunc-has-special-rules">#</a><a id="Perlfunc"></a>Perlfunc has special rules</h2>

<p>The <a href="perlfunc.html"><code>perlfunc</code> man page</a>, an exhaustive reference of every Perl built-in function, has a handful of formatting rules not seen elsewhere in Perl&#39;s documentation.</p>

<p>Software used during Perl&#39;s build process (<a href="./Pod::Functions.html">Pod::Functions</a>) parses this page according to certain rules, in order to build separate man pages for each of Perl&#39;s functions, as well as achieve other indexing effects. As such, contributors to perlfunc must know about and adhere to its particular rules.</p>

<p>Most of the perfunc man page comprises a single list, found under the header <a href="perlfunc.html#Alphabetical-Listing-of-Perl-Functions">&quot;Alphabetical Listing of Perl Functions&quot;</a>. Each function reference is an entry on that list, made of three parts, in order:</p>

<ol>

<li><p>A list of <code>=item</code> lines which each demonstrate, in template format, a way to call this function. One line should exist for every combination of arguments that the function accepts (including no arguments at all, if applicable).</p>

<p>If modern best practices prefer certain ways to invoke the function over others, then those ways should lead the list.</p>

<p>The first item of the list should be immediately followed by one or more <code>X&lt;...&gt;</code> terms listing index-worthy topics; if nothing else, then the name of the function, with no arguments.</p>

</li>
<li><p>A <code>=for</code> line, directed at <code>Pod::Functions</code>, containing a one-line description of what the function does. This is written as a phrase, led with an imperative verb, with neither leading capitalization nor ending punctuation. Examples include &quot;quote a list of words&quot; and &quot;change a filename&quot;.</p>

</li>
<li><p>The function&#39;s definition and reference material, including all explanatory text and code examples.</p>

</li>
</ol>

<p>Complex functions that need their text divided into subsections (under the principles of <a href="perldocstyle.html#Apply-section-breaks-and-examples-generously">&quot;Apply section-breaks and examples generously&quot;</a>) may do so by using sublists, with <code>=item</code> elements as header text.</p>

<p>A fictional function &quot;<code>myfunc</code>&quot;, which takes a list as an optional argument, might have an entry in perlfunc shaped like this:</p>

<pre><code class="plaintext">=item myfunc LIST
X&lt;myfunc&gt;

=item myfunc

=for Pod::Functions demonstrate a function&#39;s perlfunc section 

[ Main part of function definition goes here, with examples ]

=over

=item Legacy uses

[ Examples of deprecated syntax still worth documenting ]

=item Security considerations

[ And so on... ]

=back</code></pre>

<h1 id="TONE-AND-STYLE"><a class="permalink" href="perldocstyle.html#TONE-AND-STYLE">#</a><a id="TONE"></a>TONE AND STYLE</h1>

<h2 id="Apply-one-of-the-four-documentation-modes"><a class="permalink" href="perldocstyle.html#Apply-one-of-the-four-documentation-modes">#</a><a id="Apply"></a>Apply one of the four documentation modes</h2>

<p>Aside from &quot;meta&quot; documentation such as <code>perlhist</code> or <code>perlartistic</code>, each of Perl&#39;s man pages should conform to one of the four documentation &quot;modes&quot; suggested by <a href="https://documentation.divio.com"><i>The Documentation System</i> by Daniele Procida</a>. These include tutorials, cookbooks, explainers, and references--terms that we define in further detail below.</p>

<p>Each mode of documentation speaks to a different audience--not just people of different backgrounds and skill levels, but individual readers whose needs from language documentation can shift depending upon context. For example, a programmer with plenty of time to learn a new concept about Perl can ease into a tutorial about it, and later expand their knowledge further by studying an explainer. Later, that same programmer, wading knee-deep in live code and needing only to look up some function&#39;s exact syntax, will want to reach for a reference page instead.</p>

<p>Perl&#39;s documentation must strive to meet these different situational expectations by limiting each man page to a single mode. This helps writers ensure they provide readers with the documentation needed or expected, despite ever-evolving situations.</p>

<h3 id="Tutorial"><a class="permalink" href="perldocstyle.html#Tutorial">#</a>Tutorial</h3>

<p>A tutorial man page focuses on <b>learning</b>, ideally by <i>doing</i>. It presents the reader with small, interesting examples that allow them to follow along themselves using their own Perl interpreter. The tutorial inspires comprehension by letting its readers immediately experience (and experiment on) the concept in question. Examples include <code>perlxstut</code>, <code>perlpacktut</code>, and <code>perlretut</code>.</p>

<p>Tutorial man pages must strive for a welcoming and reassuring tone from their outset; they may very well be the first things that a newcomer to Perl reads, playing a significant role in whether they choose to stick around. Even an experienced programmer can benefit from the sense of courage imparted by a strong tutorial about a more advanced topic. After completing a tutorial, a reader should feel like they&#39;ve been led from zero knowledge of its topic to having an invigorating spark of basic understanding, excited to learn more and experiment further.</p>

<p>Tutorials can certainly use real-world examples when that helps make for clear, relatable demonstrations, so long as they keep the focus on teaching--more practical problem-solving should be left to the realm of cookbooks (as described below). Tutorials also needn&#39;t concern themselves with explanations into why or how things work beneath the surface, or explorations of alternate syntaxes and solutions; these are better handled by explainers and reference pages.</p>

<h3 id="Cookbook"><a class="permalink" href="perldocstyle.html#Cookbook">#</a>Cookbook</h3>

<p>A cookbook man page focuses on <b>results</b>. Just like its name suggests, it presents succinct, step-by-step solutions to a variety of real-world problems around some topic. A cookbook&#39;s code examples serve less to enlighten and more to provide quick, paste-ready solutions that the reader can apply immediately to the situation facing them.</p>

<p>A Perl cookbook demonstrates ways that all the tools and techniques explained elsewhere can work together in order to achieve practical results. Any explanation deeper than that belongs in explainers and reference pages, instead. (Certainly, a cookbook can cross-reference other man pages in order to satisfy the curiosity of readers who, with their immediate problems solved, wish to learn more.)</p>

<p>The most prominent cookbook pages that ship with Perl itself are its many FAQ pages, in particular <code>perlfaq4</code> and up, which provide short solutions to practical questions in question-and-answer style. <code>perlunicook</code> shows another example, containing a bevy of practical code snippets for a variety of internationally minded text manipulations.</p>

<p>(An aside: <i>The Documentation System</i> calls this mode &quot;how-to&quot;, but Perl&#39;s history of creative cuisine prefers the more kitchen-ready term that we employ here.)</p>

<h3 id="Reference"><a class="permalink" href="perldocstyle.html#Reference">#</a>Reference</h3>

<p>A reference page focuses on <b>description</b>. Austere, uniform, and succinct, reference pages--often arranged into a whole section of mutually similar subpages--lend themselves well to &quot;random access&quot; by a reader who knows precisely what knowledge they need, requiring only the minimum amount of information before returning to the task at hand.</p>

<p>Perl&#39;s own best example of a reference work is <code>perlfunc</code>, the sprawling man page that details the operation of every function built into Perl, with each function&#39;s documentation presenting the same kinds of information in the same order as every other. For an example of a shorter reference on a single topic, look at <code>perlreref</code>.</p>

<p>Module documentation--including that of all the modules listed in <a href="perlmodlib.html"><code>perlmodlib</code></a>--also counts as reference. They follow precepts similar to those laid down by the <code>perlpodstyle</code> man page, such as opening with an example-laden &quot;SYNOPSIS&quot; section, or featuring a &quot;METHODS&quot; section that succinctly lists and defines an object-oriented module&#39;s public interface.</p>

<h3 id="Explainer"><a class="permalink" href="perldocstyle.html#Explainer">#</a>Explainer</h3>

<p>Explainer pages focus on <b>discussion</b>. Each explainer dives as deep as needed into some Perl-relevant topic, taking all the time and space needed to give the reader a thorough understanding of it. Explainers mean to impart knowledge through study. They don&#39;t assume that the student has a Perl interpreter fired up and hungry for immediate examples (as with a tutorial), or specific Perl problems that they need quick answers for (which cookbooks and reference pages can help with).</p>

<p>Outside of its reference pages, most of Perl&#39;s manual belongs to this mode. This includes the majority of the man pages whose names start with &quot;<code>perl</code>&quot;. A fine example is <code>perlsyn</code>, the Perl Syntax page, which explores the whys and wherefores of Perl&#39;s unique syntax in a wide-ranging discussion laden with many references to the language&#39;s history, culture, and driving philosophies.</p>

<p>Perl&#39;s explainer pages give authors a chance to explore Perl&#39;s penchant for <a href="perlglossary.html#TMTOWTDI">TMTOWTDI</a>, illustrating alternate and even obscure ways to use the language feature under discussion. However, as the remainder of this guide discusses, the ideal Perl documentation manages to deliver its message clearly and concisely, and not confuse mere wordiness for completeness.</p>

<h3 id="Further-notes-on-documentation-modes"><a class="permalink" href="perldocstyle.html#Further-notes-on-documentation-modes">#</a><a id="Further"></a>Further notes on documentation modes</h3>

<p>Keep in mind that the purpose of this categorization is not to dictate content--a very thorough explainer might contain short reference sections of its own, for example, or a reference page about a very complex function might resemble an explainer in places (e.g. <a href="perlfunc.html#open-FILEHANDLE%2CMODE%2CEXPR"><code>open</code></a>). Rather, it makes sure that the authors and contributors of any given man page agree on what sort of audience that page addresses.</p>

<p>If a new or otherwise uncategorized man page presents itself as resistant to fitting into only one of the four modes, consider breaking it up into separate pages. That may mean creating a new &quot;<code>perl[...]</code>&quot; man page, or (in the case of module documentation) making new packages underneath that module&#39;s namespace that serve only to hold additional documentation. For instance, <code>Example::Module</code>&#39;s reference documentation might include a see-also link to <code>Example::Module::Cookbook</code>.</p>

<p>Perl&#39;s several man pages about Unicode--comprising a short tutorial, a thorough explainer, a cookbook, and a FAQ--provide a fine example of spreading a complicated topic across several man pages with different and clearly indicated purposes.</p>

<h2 id="Assume-readers&#39;-intelligence,-but-not-their-knowledge"><a class="permalink" href="perldocstyle.html#Assume-readers&#39;-intelligence,-but-not-their-knowledge">#</a><a id="Assume"></a><a id="Assume-readers-intelligence-but-not-their-knowledge"></a>Assume readers&#39; intelligence, but not their knowledge</h2>

<p>Perl has grown a great deal from its humble beginnings as a tool for people already well versed in C programming and various Unix utilities. Today, a person learning Perl might come from any social or technological background, with a range of possible motivations stretching far beyond system administration.</p>

<p>Perl&#39;s core documentation must recognize this by making as few assumptions as possible about the reader&#39;s prior knowledge. While you should assume that readers of Perl&#39;s documentation are smart, curious, and eager to learn, you should not confuse this for pre-existing knowledge about any other technology, or even programming in general--especially in tutorial or introductory material.</p>

<h3 id="Keep-Perl&#39;s-documentation-about-Perl"><a class="permalink" href="perldocstyle.html#Keep-Perl&#39;s-documentation-about-Perl">#</a><a id="Keep"></a><a id="Keep-Perls-documentation-about-Perl"></a>Keep Perl&#39;s documentation about Perl</h3>

<p>Outside of pages tasked specifically with exploring Perl&#39;s relationship with other programming languages, the documentation should keep the focus on Perl. Avoid drawing analogies to other technologies that the reader may not have familiarity with.</p>

<p>For example, when documenting one of Perl&#39;s built-in functions, write as if the reader is now learning about that function for the first time, in any programming language.</p>

<p>Choosing to instead compare it to an equivalent or underlying C function will probably not illuminate much understanding in a contemporary reader. Worse, this can risk leaving readers unfamiliar with C feeling locked out from fully understanding of the topic--to say nothing of readers new to computer programming altogether.</p>

<p>If, however, that function&#39;s ties to its C roots can lead to deeper understanding with practical applications for a Perl programmer, you may mention that link after its more immediately useful documentation. Otherwise, omit this information entirely, leaving it for other documentation or external articles more concerned with examining Perl&#39;s underlying implementation details.</p>

<h3 id="Deploy-jargon-when-needed,-but-define-it-as-well"><a class="permalink" href="perldocstyle.html#Deploy-jargon-when-needed,-but-define-it-as-well">#</a><a id="Deploy"></a><a id="Deploy-jargon-when-needed-but-define-it-as-well"></a>Deploy jargon when needed, but define it as well</h3>

<p>Domain-specific jargon has its place, especially within documentation. However, if a man page makes use of jargon that a typical reader might not already know, then that page should make an effort to define the term in question early-on--either explicitly, or via cross reference.</p>

<p>For example, Perl loves working with filehandles, and as such that word appears throughout its documentation. A new Perl programmer arriving at a man page for the first time is quite likely to have no idea what a &quot;filehandle&quot; is, though. Any Perl man page mentioning filehandles should, at the very least, hyperlink that term to an explanation elsewhere in Perl&#39;s documentation. If appropriate--for example, in the lead-in to <a href="perlfunc.html#open-FILEHANDLE%2CMODE%2CEXPR"><code>open</code> function&#39;s detailed reference</a>--it can also include a very short in-place definition of the concept for the reader&#39;s convenience.</p>

<h2 id="Use-meaningful-variable-and-symbol-names-in-examples"><a class="permalink" href="perldocstyle.html#Use-meaningful-variable-and-symbol-names-in-examples">#</a><a id="Use"></a>Use meaningful variable and symbol names in examples</h2>

<p>When quickly sketching out examples, English-speaking programmers have a long tradition of using short nonsense words as placeholders for variables and other symbols--such as the venerable <code>foo</code>, <code>bar</code>, and <code>baz</code>. Example code found in a programming language&#39;s official, permanent documentation, however, can and should make an effort to provide a little more clarity through specificity.</p>

<p>Whenever possible, code examples should give variables, classes, and other programmer-defined symbols names that clearly demonstrate their function and their relationship to one another. For example, if an example requires that one class show an &quot;is-a&quot; relationship with another, consider naming them something like <code>Apple</code> and <code>Fruit</code>, rather than <code>Foo</code> and <code>Bar</code>. Similarly, sample code creating an instance of that class would do better to name it <code>$apple</code>, rather than <code>$baz</code>.</p>

<p>Even the simplest examples benefit from clear language using concrete words. Prefer a construct like <code>for my $item (@items) { ... }</code> over <code>for my $blah (@blah) { ... }</code>.</p>

<h2 id="Write-in-English,-but-not-just-for-English-speakers"><a class="permalink" href="perldocstyle.html#Write-in-English,-but-not-just-for-English-speakers">#</a><a id="Write"></a><a id="Write-in-English-but-not-just-for-English-speakers"></a>Write in English, but not just for English-speakers</h2>

<p>While this style guide does specify American English as the documentation&#39;s language for the sake of internal consistency, authors should avoid cultural or idiomatic references available only to English-speaking Americans (or any other specific culture or society). As much as possible, the language employed by Perl&#39;s core documentation should strive towards cultural universality, if not neutrality. Regional turns of phrase, examples drawing on popular-culture knowledge, and other rhetorical techniques of that nature should appear sparingly, if at all.</p>

<p>Authors should feel free to let more freewheeling language flourish in &quot;second-order&quot; documentation about Perl, like books, blog entries, and magazine articles, published elsewhere and with a narrower readership in mind. But Perl&#39;s own docs should use language as accessible and welcoming to as wide an audience as possible.</p>

<h2 id="Omit-placeholder-text-or-commentary"><a class="permalink" href="perldocstyle.html#Omit-placeholder-text-or-commentary">#</a><a id="Omit"></a>Omit placeholder text or commentary</h2>

<p>Placeholder text does not belong in the documentation that ships with Perl. No section header should be followed by text reading only &quot;Watch this space&quot;, &quot;To be included later&quot;, or the like. While Perl&#39;s source files may shift and alter as much as any other actively maintained technology, each released iteration of its technology should feel complete and self-contained, with no such future promises or other loose ends visible.</p>

<p>Take advantage of Perl&#39;s regular release cycle. Instead of cluttering the docs with flags promising more information later--the presence of which do not help readers at all today--the documentation&#39;s maintenance team should treat any known documentation absences as an issue to address like any other in the Perl project. Let Perl&#39;s contributors, testers, and release engineers address that need, and resist the temptation to insert apologies, which have all the utility in documentation as undeleted debug messages do in production code.</p>

<h2 id="Apply-section-breaks-and-examples-generously"><a class="permalink" href="perldocstyle.html#Apply-section-breaks-and-examples-generously">#</a><a id="Apply1"></a>Apply section-breaks and examples generously</h2>

<p>No matter how accessible their tone, the sight of monolithic blocks of text in technical documentation can present a will-weakening challenge for the reader. Authors can improve this situation through breaking long passages up into subsections with short, meaningful headers.</p>

<p>Since every section-header in Pod also acts as a potential end-point for a cross-reference (made via Pod&#39;s <code>L&lt;...&gt;</code> syntax), putting plenty of subsections in your documentation lets other man pages more precisely link to a particular topic. This creates hyperlinks directly to the most appropriate section rather than to the whole page in general, and helps create a more cohesive sense of a rich, consistent, and interrelated manual for readers.</p>

<p>Among the four documentation modes, sections belong more naturally in tutorials and explainers. The step-by-step instructions of cookbooks, or the austere definitions of reference pages, usually have no room for them. But authors can always make exceptions for unusually complex concepts that require further breakdown for clarity&#39;s sake.</p>

<p>Example code, on the other hand, can be a welcome addition to any mode of documentation. Code blocks help break up a man page visually, reassuring the reader that no matter how deep the textual explanation gets, they are never far from another practical example showing how it all comes together using a small, easy-to-read snippet of tested Perl code.</p>

<h2 id="Lead-with-common-cases-and-best-practices"><a class="permalink" href="perldocstyle.html#Lead-with-common-cases-and-best-practices">#</a><a id="Lead"></a>Lead with common cases and best practices</h2>

<p>Perl famously gives programmers more than one way to do things. Like any other long-lived programming language, Perl has also built up a large, community-held notion of best practices, blessing some ways to do things as better than others, usually for the sake of more maintainable code.</p>

<h3 id="Show-the-better-ways-first"><a class="permalink" href="perldocstyle.html#Show-the-better-ways-first">#</a><a id="Show"></a>Show the better ways first</h3>

<p>Whenever it needs to show the rules for a technique which Perl provides many avenues for, the documentation should always lead with best practices. And when discussing some part of the Perl toolkit with many applications, the docs should begin with a demonstration of its application to the most common cases.</p>

<p>The <code>open</code> function, for example, has myriad potential uses within Perl programs, but <i>most of the time</i> programmers--and especially those new to Perl--turn to this reference because they simply wish to open a file for reading or writing. For this reason, <code>open</code>&#39;s documentation begins there, and only descends into the function&#39;s more obscure uses after thoroughly documenting and demonstrating how it works in the common case. Furthermore, while engaging in this demonstration, the <code>open</code> documentation does not burden the reader right away with detailed explanations about calling <code>open</code> via any route other than the best-practice, three-argument style.</p>

<h3 id="Show-the-lesser-ways-when-needed"><a class="permalink" href="perldocstyle.html#Show-the-lesser-ways-when-needed">#</a><a id="Show1"></a>Show the lesser ways when needed</h3>

<p>Sometimes, thoroughness demands documentation of deprecated techniques. For example, a certain Perl function might have an alternate syntax now considered outmoded and no longer best-practice, but which a maintainer of a legacy project might quite reasonably encounter when exploring old code. In this case, these features deserve documentation, but couched in clarity that modern Perl avoids such structures, and does not recommend their use in new projects.</p>

<p>Another way to look at this philosophy (and one <a href="https://devguide.python.org/documenting/#affirmative-tone">borrowed from our friends</a> on Python&#39;s documentation team) involves writing while sympathizing with a programmer new to Perl, who may feel uncertain about learning a complex concept. By leading that concept&#39;s main documentation with clear, positive examples, we can immediately give these readers a simple and true picture of how it works in Perl, and boost their own confidence to start making use of this new knowledge. Certainly we should include alternate routes and admonitions as reasonably required, but we needn&#39;t emphasize them. Trust the reader to understand the basics quickly, and to keep reading for a deeper understanding if they feel so driven.</p>

<h2 id="Document-Perl&#39;s-present"><a class="permalink" href="perldocstyle.html#Document-Perl&#39;s-present">#</a><a id="Document1"></a><a id="Document-Perls-present"></a>Document Perl&#39;s present</h2>

<p>Perl&#39;s documentation should stay focused on Perl&#39;s present behavior, with a nod to future directions.</p>

<h3 id="Recount-the-past-only-when-necessary"><a class="permalink" href="perldocstyle.html#Recount-the-past-only-when-necessary">#</a><a id="Recount"></a>Recount the past only when necessary</h3>

<p>When some Perl feature changes its behavior, documentation about that feature should change too, and just as definitively. The docs have no obligation to keep descriptions of past behavior hanging around, even if attaching clauses like &quot;Prior to version 5.10, [...]&quot;.</p>

<p>Since Perl&#39;s core documentation is part of Perl&#39;s source distribution, it enjoys the same benefits of versioning and version-control as the source code of Perl itself. Take advantage of this, and update the text boldly when needed. Perl&#39;s history remains safe, even when you delete or replace outdated information from the current version&#39;s docs.</p>

<p>Perl&#39;s docs can acknowledge or discuss former behavior when warranted, including notes that some feature appeared in the language as of some specific version number. Authors should consider applying principles similar to those for deprecated techniques, <a href="perldocstyle.html#Show-the-lesser-ways-when-needed">as described above</a>: make the information present, but not prominent.</p>

<p>Otherwise, keep the past in the past. A manual uncluttered with outdated instruction stays more succinct and relevant.</p>

<h3 id="Describe-the-uncertain-future-with-care"><a class="permalink" href="perldocstyle.html#Describe-the-uncertain-future-with-care">#</a><a id="Describe"></a>Describe the uncertain future with care</h3>

<p>Perl features marked as &quot;experimental&quot;--those that generate warnings when used in code not invoking the <a href="experimental.html"><code>experimental</code></a> pragma--deserve documentation, but only in certain contexts, and even then with caveats. These features represent possible new directions for Perl, but they have unstable interfaces and uncertain future presence.</p>

<p>The documentation should take both implications of &quot;experimental&quot; literally. It should not discourage these features&#39; use by programmers who wish to try out new features in projects that can risk their inherent instability; this experimentation can help Perl grow and improve. By the same token, the docs should downplay these features&#39; use in just about every other context.</p>

<p>Introductory or overview material should omit coverage of experimental features altogether.</p>

<p>More thorough reference materials or explanatory articles can include experimental features, but needs to clearly mark them as such, and not treat them with the same prominence as Perl&#39;s stable features. Using unstable features seldom coincides with best practices, and documentation that <a href="perldocstyle.html#Lead-with-common-cases-and-best-practices">puts best practices first</a> should reflect this.</p>

<h2 id="The-documentation-speaks-with-one-voice"><a class="permalink" href="perldocstyle.html#The-documentation-speaks-with-one-voice">#</a><a id="The"></a>The documentation speaks with one voice</h2>

<p>Even though it comes from many hands and minds, criss-crossing through the many years of Perl&#39;s lifetime, the language&#39;s documentation should speak with a single, consistent voice. With few exceptions, the docs should avoid explicit first-person-singular statements, or similar self-reference to any individual&#39;s contributor&#39;s philosophies or experiences.</p>

<p>Perl did begin life as a deeply personal expression by a single individual, and this famously carried through the first revisions of its documentation as well. Today, Perl&#39;s community understands that the language&#39;s continued development and support comes from many people working in concert, rather than any one person&#39;s vision or effort. Its documentation should not pretend otherwise.</p>

<p>The documentation should, however, carry forward the best tradition that Larry Wall set forth in the language&#39;s earliest days: Write both economically and with a humble, subtle wit, resulting in a technical manual that mixes concision with a friendly approachability. It avoids the dryness that one might expect from technical documentation, while not leaning so hard into overt comedy as to distract and confuse from the nonetheless-technical topics at hand.</p>

<p>Like the best written works, Perl&#39;s documentation has a soul. Get familiar with it as a reader to internalize its voice, and then find your own way to express it in your own contributions. Writing clearly, succinctly, and with knowledge of your audience&#39;s expectations will get you most of the way there, in the meantime.</p>

<p>Every line in the docs--whether English sentence or Perl statement--should serve the purpose of bringing understanding to the reader. Should a sentence exist mainly to make a wry joke that doesn&#39;t further the reader&#39;s knowledge of Perl, set it aside, and consider recasting it into a personal blog post or other article instead.</p>

<p>Write with a light heart, and a miserly hand.</p>

<h1 id="INDEX-OF-PREFERRED-TERMS"><a class="permalink" href="perldocstyle.html#INDEX-OF-PREFERRED-TERMS">#</a><a id="INDEX"></a>INDEX OF PREFERRED TERMS</h1>

<p><a href="perldocstyle.html#Choice-of-underlying-style-guide%3A-CMOS">As noted above</a>, this guide &quot;inherits&quot; all the preferred terms listed in the Chicago Manual of Style, 17th edition, and adds the following terms of particular interest to Perl documentation.</p>

<dl>

<dt id="built-in-function"><a class="permalink" href="perldocstyle.html#built-in-function">#</a><a id="built"></a>built-in function</dt>
<dd>

<p>Not &quot;builtin&quot;.</p>

</dd>
<dt id="Darwin"><a class="permalink" href="perldocstyle.html#Darwin">#</a>Darwin</dt>
<dd>

<p>See <a href="perldocstyle.html#macOS">macOS</a>.</p>

</dd>
<dt id="macOS"><a class="permalink" href="perldocstyle.html#macOS">#</a>macOS</dt>
<dd>

<p>Use this term for Apple&#39;s operating system instead of &quot;Mac OS X&quot; or variants thereof.</p>

<p>This term is also preferable to &quot;Darwin&quot;, unless one needs to refer to macOS&#39;s Unix layer specifically.</p>

</dd>
<dt id="man-page"><a class="permalink" href="perldocstyle.html#man-page">#</a><a id="man"></a>man page</dt>
<dd>

<p>One unit of Unix-style documentation. Not &quot;manpage&quot;. Preferable to &quot;manual page&quot;.</p>

</dd>
<dt id="Perl;-perl"><a class="permalink" href="perldocstyle.html#Perl;-perl">#</a><a id="Perl"></a><a id="Perl-perl"></a>Perl; perl</dt>
<dd>

<p>The name of the programming language is Perl, with a leading capital &quot;P&quot;, and the remainder in lowercase. (Never &quot;PERL&quot;.)</p>

<p>The interpreter program that reads and executes Perl code is named &quot;<code>perl</code>&quot;, in lowercase and in monospace (as with any other command name).</p>

<p>Generally, unless you are specifically writing about the command-line <code>perl</code> program (as, for example, <a href="perlrun.html"><code>perlrun</code></a> does), use &quot;Perl&quot; instead.</p>

</dd>
<dt id="Perl-5"><a class="permalink" href="perldocstyle.html#Perl-5">#</a><a id="Perl1"></a>Perl 5</dt>
<dd>

<p>Documentation need not follow Perl&#39;s name with a &quot;5&quot;, or any other number, except during discussions of Perl&#39;s history, future plans, or explicit comparisons between major Perl versions.</p>

<p>Before 2019, specifying &quot;Perl 5&quot; was sometimes needed to distinguish the language from Perl 6. With the latter&#39;s renaming to &quot;Raku&quot;, this practice became unnecessary.</p>

</dd>
<dt id="Perl-6"><a class="permalink" href="perldocstyle.html#Perl-6">#</a><a id="Perl2"></a>Perl 6</dt>
<dd>

<p>See <a href="perldocstyle.html#Raku">Raku</a>.</p>

</dd>
<dt id="Perl-5-Porters,-the;-porters,-the;-p5p"><a class="permalink" href="perldocstyle.html#Perl-5-Porters,-the;-porters,-the;-p5p">#</a><a id="Perl3"></a><a id="Perl-5-Porters-the-porters-the-p5p"></a>Perl 5 Porters, the; porters, the; p5p</dt>
<dd>

<p>The full name of the team responsible for Perl&#39;s ongoing maintenance and development is &quot;the Perl 5 Porters&quot;, and this sobriquet should be spelled out in the first mention within any one document. It may thereafter call the team &quot;the porters&quot; or &quot;p5p&quot;.</p>

<p>Not &quot;Perl5 Porters&quot;.</p>

</dd>
<dt id="program"><a class="permalink" href="perldocstyle.html#program">#</a>program</dt>
<dd>

<p>The most general descriptor for a stand-alone work made out of executable Perl code. Synonymous with, and preferable to, &quot;script&quot;.</p>

</dd>
<dt id="Raku"><a class="permalink" href="perldocstyle.html#Raku">#</a>Raku</dt>
<dd>

<p>Perl&#39;s &quot;sister language&quot;, whose homepage is <a href="https://raku.org">https://raku.org</a>.</p>

<p>Previously known as &quot;Perl 6&quot;. In 2019, its design team renamed the language to better reflect its identity as a project independent from Perl. As such, Perl&#39;s documentation should always refer to this language as &quot;Raku&quot; and not &quot;Perl 6&quot;.</p>

</dd>
<dt id="script"><a class="permalink" href="perldocstyle.html#script">#</a>script</dt>
<dd>

<p>See <a href="perldocstyle.html#program">program</a>.</p>

</dd>
<dt id="semicolon"><a class="permalink" href="perldocstyle.html#semicolon">#</a>semicolon</dt>
<dd>

<p>Perl code&#39;s frequently overlooked punctuation mark. Not &quot;semi-colon&quot;.</p>

</dd>
<dt id="Unix"><a class="permalink" href="perldocstyle.html#Unix">#</a>Unix</dt>
<dd>

<p>Not &quot;UNIX&quot;, &quot;*nix&quot;, or &quot;Un*x&quot;. Applicable to both the original operating system from the 1970s as well as all its conceptual descendants. You may simply write &quot;Unix&quot; and not &quot;a Unix-like operating system&quot; when referring to a Unix-like operating system.</p>

</dd>
</dl>

<h1 id="SEE-ALSO"><a class="permalink" href="perldocstyle.html#SEE-ALSO">#</a><a id="SEE"></a>SEE ALSO</h1>

<ul>

<li><p><a href="perlpod.html">perlpod</a></p>

</li>
<li><p><a href="perlpodstyle.html">perlpodstyle</a></p>

</li>
</ul>

<h1 id="AUTHOR"><a class="permalink" href="perldocstyle.html#AUTHOR">#</a>AUTHOR</h1>

<p>This guide was initially drafted by Jason McIntosh (jmac@jmac.org), under a grant from The Perl Foundation.</p>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
